<template>
	<!-- 课程详情页 -->
	<div class="qy-page-course-detail">
		<uni-nav-bar fixed shadow :border="false" :title="info.name || title" left-icon="left"
			@clickLeft="goBefore"></uni-nav-bar>
		<div class="iframe-wrap" >
			<iframe :src="viewUrl" id="iframepage" name="iframepage" frameBorder=0 width="100%" height="100%"></iframe>
		</div>
	</div>
</template>

<script>
	import {
		guid,
		dealFaultLearnStatus
	} from '@/assets/js/util'
	import mockData from "@/mock/live/live.json"
	export default {

		head() {
			return {
				title: this.title
			}
		},
		components: {},
		data() {
			return {
				title: '直播',
				id: "", // ID
				info: {}, // 基础信息
				viewUrl: ''
			}
		},
		onLoad(query) {
			this.id = query.id || ''
		},
		
		mounted() {
			this.getInfo()
		},
		onShow(){
		},
		onHide() {
		},
		computed: {},
	
		methods: {
			goBefore() {
				uni.navigateBack({
					delta: 2
				})
			},

			// 获取课程详情
			getInfo() {
			 this.info=mockData.data;
			 this.viewUrl=mockData.data.roomLiveList[0].replayUrl
			}
		}
	};
</script>

<style lang="scss" scoped>
	.qy-page-course-detail {
		.iframe-wrap {
			height: calc(100vh - 46px);

			iframe {
				height: 100%;
				vertical-align: middle;
			}
		}
	}
</style>